package com.weirdor.wchat.module.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.weirdor.wchat.module.entity.SysUser;
import com.weirdor.wchat.module.mapper.SysUserMapper;
import com.weirdor.wchat.module.service.ISysUserService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 系统用户 服务实现类
 * </p>
 *
 * @author weirdor
 * @since 2018-03-05
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Autowired
    private  SysUserMapper sysUserMapper;

    @Override
    public SysUser queryByUserName(String username) {
        EntityWrapper<SysUser> ew=new EntityWrapper<>();
        ew.eq("username",username);
        return super.selectOne(ew);
    }

    @Override
    public List<String> queryAllPerms(long userId) {
        return sysUserMapper.queryAllPerms(userId);
    }
}
